package com.ebs.gparecorderweb.model;

public enum Grades {
	A ("A", 4.00),
	AN ("A-", 3.70),
	BP ("B+", 3.33),
	B ("B", 3.00),
	BN ("B-", 2.7),
	CP ("CP", 2.30),
	C ("C", 2.00),
	CN ("C-", 1.70),
	DP ("D+", 1.30),
	D ("D", 1.00),
	DN ("D-", 0.70);
	
	private final String name;
	private final double point;
	
	private Grades(String name, double point){
		this.name = name;
		this.point = point;
	}
	
	public double getValue(String s){
		for(Grades g : Grades.values()){
			if(g.name.equals(s)){
				return g.point;
			}
		}
		return -1;
	}
}
